package org.example.mapper;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface Kaidianmapper {

    /**
     * 新增
     * @param yonghu
     * @param dianpu
     */
    @Insert("INSERT INTO kaidian (yonghuusername,dianpuusername)\n" +
            "VALUES\n" +
            "(#{yonghu},#{dianpu})")
    void xz(String yonghu, String dianpu);

    /**
     * 查询
     * @param yonghu
     * @return
     */
    @Select("select dianpuusername from kaidian where yonghuusername=#{yonghu}")
    String cx(String yonghu);

    /**
     * 删除
     * @param username
     */
    @Delete("delete from kaidian where  yonghuusername=#{yonghu}")
    void sc(String username);
    @Delete("delete from kaidian where  dianpuusername=#{username}")
    void sczh(String username);
    @Delete("delete from categories where  username=#{username}")
    void scz(String username);
}
